{% load bootstrap3 %}
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Luo Chunhui">
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico">

    <title>API for JFPAL</title>

    <!-- Bootstrap core CSS -->
    {% bootstrap_css %}
    {% bootstrap_javascript jquery=True %}

    <!-- Custom styles for this template -->
    <link href="{% static "api/grid.css" %}" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
    <!-- Fixed navbar -->
    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Jfapl产品<sup>Pro</sup>API</a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Top</a></li>
            <li><a href="#instruction">说明</a></li>
            <li><a href="#startup">Startup</a></li>
            <li class="dropdown">
              <a href="#module" class="dropdown-toggle" data-toggle="dropdown">模块 <b class="caret"> </b></a>
              <ul class="dropdown-menu">
                <li><a href="#module">模块</a></li>
                <li><a href="#module_list">列表</a></li>
                <li><a href="#module_download">下载</a></li>
              </ul>
            </li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">微店 <b class="caret"> </b></a>
              <ul class="dropdown-menu">
                <li><a href="#tinyshop">微店</a></li>
                <li><a href="#product">商品</a></li>
                <li><a href="#order">订单</a></li>
              </ul>
            </li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li class="active"><a href="###">Powered By Jfpal Pro</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>
    <div class="container">
      {% bootstrap_messages %}

      <div class="page-header">
        <h1>即付宝产品部后端接口文档</h1>
        <p class="lead">此文档禁止对外开放，请在部署过程中，严格注意！</p>
      </div>

      <table class="table table-condensed">
          <thead>
            <tr>
                <th>接口名称/接口说明</th>
                <th>接口方法</th>
                <th>接口参数＆返回</th>
            </tr>
        </thead>
        <tbody id="instruction">
            <tr>
                <td colspan="4"><span class="btn btn-lg btn-primary">接口说明</span></td>
            </tr>
            <tr>
                <td>概要:</td>
                <td>&nbsp;</td>
                <td><pre>
接口版本：
    0： 未开始
    1: 接口已设计
    α: 接口已实现，但不稳定. 也可申请变化
    β: 接口已稳定
    γ: 接口已稳定,运营使用中
客户端请求方式:
    Http协议
    Cookie开启
    GET/POST请求

客户端请求接口：
    http://v2.wodula.com/? 接口域名以后可能会改变。
客户端请求参数：
    固定参数：
        requestMethod=接口名 必须
        attachSign=客户端自定义数据  可选，服务器端将原样返回。 主要用于客户端异步请求标志识别。
    其他参数：
        根据接口不同，传递其他参数
客户端请求实例：
    http://api.address.url/api?r=module.module.list&amp;id=1&amp;resolution=320x640
    使用GET方式，请求 module.module.list 接口， 附加两个接口参数为： id=1, resolution=320x640
返回结果:
    除特殊说明,返回结果为json格式.
    返回结果格式:
    {"success":true,                   返回结果状态码
     "msg":"",                      错误信息
     "r":"Book.index",  请求的接口.按照客户端发送的requestMethod字符串参数,原样返回.
     "sign":""                对服务器端无意义.按照客户端发送的sign字符串参数,原样返回.
     "token":""                   用户SESSIONID识别符
     "module_list":[...],      返回的其他业务数据, 根据业务不同各异
    }
</pre></td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td>HEAD参数:</td>
                <td>&nbsp;</td>
                <td><pre>
客户端需要在HEAD中加入参数：
    APP: jfpal
    APP-VERSION: 3.0
如果有登陆态，需加上：
    TOKEN: abr916tuj6ih2dqhul6ahcn2d6 (与传统浏览器中的 SESSIONID 等价)
</pre></td>
            </tr>
            <tr>
                <td>特殊错误:</td>
                <td>必须登陆</td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{"status":-4,"msg":"请先登陆","r":"store.list.my","sign":""}
</pre></td>
                <td>&nbsp;</td>
            </tr>
        </tbody>

        <tbody id="startup">
            <tr>
                <td colspan="4"><span class="btn btn-lg btn-primary">模块: Startup</span></td>
            </tr>
            <tr>
                <td>启动时<br />
                    获取与服务器、App相关的信息<br />
                    主要用于数据或环境初始化<br />
                    返回app所需环境变量
                </td>
                <td><a class="request" href="/api/?r=startup.app.settings">startup.app.settings</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
 "lastest_version": "3.0.0",
 "media_url": "/media/"
}
</pre></td>
            </tr>
            <tr>
                <td>反馈<br />
                    用户反馈信息。 提交时，将可获得的app版本、手机型号、网络等信息都提交上来。
                </td>
                <td><a class="request" href="/api/?r=feedback.feedback.create" data-post='{"mobile_no":"18621509988","platform":"iOS","app_version":"3.0.0","app_user":"jfpal","content":"Great App","os_info":"osversion:7.1\ncoloe:white"}'>feedback.feedback.create</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509988  手机号
  <i class="glyphicon glyphicon-plus-sign"></i>platform=app系统。 仅可为  iOS / Android
  <i class="glyphicon glyphicon-plus-sign"></i>app_version=App版本号
  <i class="glyphicon glyphicon-plus-sign"></i>app_user=代理商号
  <i class="glyphicon glyphicon-plus-sign"></i>content= 问题反馈内容
  <i class="glyphicon glyphicon-plus-sign"></i>os_info= 系统信息。
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
feedback: {
 "pk": 1,
 "mobile_no": "18621509988",
 "platform": "iOS"
}
</pre></td>
            </tr>
          </tbody>
          
          <tbody id="module">
            <tr>
                <td colspan="4"><span class="btn btn-lg btn-primary">模块: Module</span></td>
            </tr>
            <tr>
                <td>模块列表<br />
                    获取与服务器、App相关的信息<br />
                    主要用于数据或环境初始化<br />
                    返回app所需环境变量
                </td>
                <td><a class="request" href="/api/?r=startup.app.settings">module.module.list</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
 "lastest_version": "3.0.0",
 "media_url": "/media/"
}
</pre></td>
            </tr>
          </tbody>
          
          <tbody id="module">
            <tr>
                <td colspan="4"><span class="btn btn-lg btn-primary">模块: Help</span></td>
            </tr>
            <tr>
                <td>监控手机列表<br /> </td>
                <td><a class="request" href="/api/?r=faq.help.phonedetect">faq.help.phonedetect</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
 "lastest_version": "3.0.0",
 "media_url": "/media/"
}
</pre></td>
            </tr>
          </tbody>
          
          <tbody id="flagship">
            <tr>
                <td colspan="4"><span class="btn btn-lg btn-primary">模块: 旗舰店</span></td>
            </tr>
            <tr>
                <td>新建微店<br />
                    通过手机号码，新建微店<br />
                    如该手机号已开微店，则抛错
                </td>

                <td><a class="request" href="/api/?r=flagship.index.list" data-get='{"appuser":"jfpal"}'>flagship.index.list</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
  <i class="glyphicon glyphicon-plus-sign"></i>appuser=jfpal           AppUser

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "flagships": [{
        "id": 4,
        "name": "钱庄",
    },{
        "id": 4,
        "name": "钱庄",
    }],
}
</pre></td>
            </tr>
          </tbody>
          
          <tbody id="customer">
            <tr>
                <td colspan="4"><span class="btn btn-lg btn-primary">模块: Customer</span></td>
            </tr>
            <tr>
                <td>获取用户地址列表</td>
                <td><a class="request" href="/api/?r=customer.address.list">customer.address.list</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
	
}
</pre></td>
            </tr>
            <tr>
                <td>新增用户地址列表</td>
                <td><a class="request" href="/api/?r=customer.address.create" data-post='{"name":"罗晖","province":"上海","city":"上海","address":"证劵大厦19楼","tel":"18621509999"}'>customer.address.create</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>name=罗晖  姓名
  <i class="glyphicon glyphicon-plus-sign"></i>province=上海 仅可为  iOS / Android
  <i class="glyphicon glyphicon-plus-sign"></i>city=上海
  <i class="glyphicon glyphicon-plus-sign"></i>address=证劵大厦19楼
  <i class="glyphicon glyphicon-plus-sign"></i>tel=18621509999
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
feedback: {
 "pk": 1,
 "mobile_no": "18621509988",
 "platform": "iOS"
}
</pre></td>
            </tr>
            <tr>
                <td>删除用户地址列表</td>
                <td><a class="request" href="/api/?r=customer.address.remove" data-post='{"address_id":2}'>customer.address.remove</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>address_id=2  地址ID
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
feedback: {
 "pk": 1,
 "mobile_no": "18621509988",
 "platform": "iOS"
}
</pre></td>
            </tr>
            <tr>
                <td>获得用户订单列表</td>
                <td><a class="request" href="/api/?r=customer.order.list">customer.order.list</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
orders: {
 "pk": 1,
 "mobile_no": "18621509988",
 "platform": "iOS"
}
</pre></td>
            </tr>
          </tbody>

          <tbody id="store">
            <tr>
                <td colspan="4"><span class="btn btn-lg btn-primary">模块: 微店</span></td>
            </tr>
            
            <tr>
                <td>新建微店<br />
                    通过手机号码，新建微店<br />
                    如该手机号已开微店，则抛错
                </td>

                <td><a class="request" href="/api/?r=store.tinyshop.login" data-post='{"mobile_no":"18621509910","username":"罗", "token": "aabbccds"}'>store.tinyshop.login</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509988  手机号
  <i class="glyphicon glyphicon-plus-sign"></i>username=星巴克   用户名
  <i class="glyphicon glyphicon-plus-sign"></i>token=AABBCC

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "tiyshop": {
        "id": 4,
        "name": "钱庄",
        "account": 0,
        "sales": "",
        "logo": null,
        "balance": 0,
        "mobile_no": "18621509988"
    },
}
</pre></td>
            </tr>
            
            
            
            
            <tr>
                <td>新建微店<br />
                    通过手机号码，新建微店<br />
                    如该手机号已开微店，则抛错
                </td>

                <td><a class="request" href="/api/?r=store.tinyshop.create" data-post='{"mobile_no":"18621509988","name":"星巴克"}'>store.tinyshop.create</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509988  手机号
  <i class="glyphicon glyphicon-plus-sign"></i>name=星巴克            微店名称

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "tiyshop": {
        "id": 4,
        "name": "钱庄",
        "account": 0,
        "sales": "",
        "logo": null,
        "balance": 0,
        "mobile_no": "18621509988"
    },
}
</pre></td>
            </tr>
            <tr>
                <td>新建微店<br />
                    通过手机号码，新建微店<br />
                    如该手机号已开微店，则抛错
                </td>

                <td><a class="request" href="/api/?r=store.tinyshop.create" data-post='{"mobile_no":"18621509988","name":"星巴克","image_id":"1"}'>store.tinyshop.update</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509988  手机号
  <i class="glyphicon glyphicon-plus-sign"></i>name=星巴克            微店名称
  <i class="glyphicon glyphicon-plus-sign"></i>image_id=1            图片ID
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "tiyshop": {
        "id": 4,
        "name": "钱庄",
        "account": 0,
        "sales": "",
        "logo": null,
        "balance": 0,
        "mobile_no": "18621509988"
    },
}
</pre></td>
            </tr>
            <tr>
                <td>搜索微店<br />
                    通过手机号码、微店ID、微店名称，搜索微店，返回微店信息<br />
                    如果没有找到，则抛错<br />
                </td>

                <td><a class="request" href="/api/?r=store.tinyshop.search" data-get='{"k":"15221722310"}'>store.tinyshop.search</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
  <i class="glyphicon glyphicon-plus-sign"></i>k=15221722310  搜索条件，可以为手机号码、微店ID、微店名称

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "tiyshop_list": [{
        "id": 4,
        "name": "钱庄",
        "account": 0,
        "sales": "",
        "logo": null,
        "balance": 0,
        "mobile_no": "18621509988"
    }]
}
</pre></td>
            </tr>
            <tr>
                <td>微店信息<br />
                    通过微店ID,获得微店信息<br />
                    如该手机号已开微店，则抛错。
                    在进入管理页面时，增加name用户名参数，post上来。如果店铺不存在，将以此为店铺名自动新建店铺
                </td>

                <td><a class="request" href="/api/?r=store.tinyshop.detail" data-get='{"mobile_no":18621509911}'>store.tinyshop.detail</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET/POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509988  微店手机号
  <i class="glyphicon glyphicon-plus-plus"></i>name=张三  微店的用户名

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "tiyshop": {
        "id": 4,
        "name": "钱庄",
        "account": 0,
        "sales": "",
        "logo": null,
        "balance": 0,
        "mobile_no": "18621509988"
    },
}
</pre></td>
            </tr>
            <tr>
                <td>创建商品<br />
                    通过微店ID,获得商品信息<br />
                    创建商品
                </td>
                
                
                <td><a class="request" href="/api/?r=store.tinyshop.imagecreate" data-post='{"tinyshop_id":1}'>store.tinyshop.imagecreate</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>tiyshop_id=1  微店ID
  <i class="glyphicon glyphicon-plus-sign"></i>image=file  微店图片
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "tinyshop": {
        "id": 4,
    },
}
</pre></td>
            </tr>
            
          <tr>
                <td>创建商品<br />
                    通过微店ID,获得商品信息<br />
                    创建商品
                </td>
                
                <td><a class="request" href="/api/?r=store.product.imagecreate" data-post='{"mobile_no":"18621509911"}'>store.product.imagecreate</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509911  微店ID
  <i class="glyphicon glyphicon-plus-sign"></i>image=file  产品图片

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "image": {
        "id": 4,
    },
}
</pre></td>
            </tr>
            
          <tr>
                <td>创建商品<br />
                    通过微店ID,获得商品信息<br />
                    创建商品
                </td>
                
                

                <td><a class="request" href="/api/?r=store.product.create" data-post='{"tinyshop_id":1,"name":"娃哈哈", "image_id":"1","price":10.00,"information":"lala"}'>store.product.create</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>tiyshop_id=1  微店ID
  <i class="glyphicon glyphicon-plus-sign"></i>image_id=娃哈哈  商品名称
  <i class="glyphicon glyphicon-minus-sign"></i>name=产品名 
  <i class="glyphicon glyphicon-minus-sign"></i>price=0  商品价格
  <i class="glyphicon glyphicon-minus-sign"></i>information="" 商品详情

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "product": {
        "id": 4,
        "name": "娃哈哈",
        "price": 0,
        "information": "",
    },
}
</pre></td>
            </tr>
            <tr>
                <td>商品更新<br />
                    获得新的商品信息，保存到数据库<br />
                    返回更新后的商品详细信息
                </td>

                <td><a class="request" href="/api/?r=store.product.update" data-post='{"product_id":10001,"name":"娃哈哈2", "image_id":"101","price":100.00,"information":"ll"}'>store.product.update</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>product_id=1  商品ID
  <i class="glyphicon glyphicon-plus-sign"></i>tiyshop_id=1  微店ID
  <i class="glyphicon glyphicon-plus-sign"></i>image_id=娃哈哈  商品名称
  <i class="glyphicon glyphicon-minus-sign"></i>name=产品名 
  <i class="glyphicon glyphicon-minus-sign"></i>price=0  商品价格
  <i class="glyphicon glyphicon-minus-sign"></i>information="" 商品详情

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "product": {
        "id": 4,
        "name": "娃哈哈",
        "price": 0,
        "information": " ",
    },
}
</pre></td>
            </tr>
            
                    <tr>
                <td>删除商品<br />
                    通过商品ID，删除商品<br />
                </td>

                <td><a class="request" href="/api/?r=store.product.delete" data-post='{"product_id":10002}'>store.product.delete</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
  <i class="glyphicon glyphicon-plus-sign"></i>product_id=1  微店ID

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
   "product": {
                    "url": "/Product/1/",
                    "tinyshop": "/TinyShop/1/",
                    "name": "434",
                    "image": "fg",
                    "price": "34.00",
                    "information": "g",
                    "status": 0
                    }
}
</pre></td>
            </tr>
          <tr>
                <td>商品详情<br />
                    通过微店ID,获得商品信息<br />
                    返回商品的详细信息
                </td>

                <td><a class="request" href="/api/?r=store.product.detail" data-get='{"product_id":1}'>store.product.detail</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
  <i class="glyphicon glyphicon-plus-sign"></i>product_id=1  微店ID

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
   "product": {
                    "url": "/Product/1/",
                    "tinyshop": "/TinyShop/1/",
                    "name": "434",
                    "image": "fg",
                    "price": "34.00",
                    "information": "g",
                    "status": 0
                    }
}
</pre></td>
            </tr>
                    <tr>
                <td>商品展示<br />
                    获得微店ID，搜索出该微店的商品<br />
                    返回微店的商品列表
                </td>

                <td><a class="request" href="/api/?r=store.product.list" data-get='{"mobile_no":"18621509911"}'>store.product.list</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
  <i class="glyphicon glyphicon-plus-sign"></i>tinyshop_id=1  商品ID
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "product_list": [{
                    "url": "/Product/1/",
                    "tinyshop": "/TinyShop/1/",
                    "name": "434",
                    "image": "fg",
                    "price": "34.00",
                    "information": "g",
                    "status": 0
                    }]
}
</pre></td>
            </tr>
                    <tr>
                <td>订单提交<br />
                    获得购买商品信息，生成订单信息<br />
                    返回生成的订单详细信息
                </td>

                <td><a class="request" href="/api/?r=store.order.submit" data-post='{"mobile_no":"18621509911","payer_id":"18621509912","detail":"[[1,34,5],[2,22,6]]","amount":"100.00"}'>store.order.submit</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509911  商品ID
  <i class="glyphicon glyphicon-plus-sign"></i>payer_id="43434343" 支付人账户
  <i class="glyphicon glyphicon-plus-sign"></i>detail=[1,33,3],[2,33,3]  商品详情,[product_id,product_price,product_num]
  <i class="glyphicon glyphicon-plus-sign"></i>amount=100.00 订单金额
  

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "order": {
                    "id": 10,
                    "tinyshop": 1,
                    "date": "2014-03-03T15:26:58.938",
                    "amount": "170.00",
                    "payer": "\"12\"",
                    "detail": "[[1,34,5]]",
                    "payment": "",
                    "status": 2
                    }
}
</pre></td>
            </tr>
            
            <tr>
                <td>订单提交2<br />
                    获得购买商品信息，生成订单信息<br />
                    返回生成的订单详细信息
                </td>

                <td><a class="request" href="/api/?r=store.order.submit" data-post='{"mobile_no":"18621509911","payer_id":"18621509912","detail":"[[1,34,5],[2,22,6]]","amount":"100.00","needexpress":"1","address":"{\"name\":\"罗春晖\",\"province\":\"上海\",\"city\":\"上海\",\"address\":\"金茂大厦88楼\",\"tel\":\"18621509911\"}"}'>store.order.submit</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>mobile_no=18621509911  商品ID
  <i class="glyphicon glyphicon-plus-sign"></i>payer_id="43434343" 支付人账户
  <i class="glyphicon glyphicon-plus-sign"></i>detail=[1,33,3],[2,33,3]  商品详情,[product_id,product_price,product_num]
  <i class="glyphicon glyphicon-plus-sign"></i>amount=100.00 订单金额
  <i class="glyphicon glyphicon-plus-sign"></i>needexpress=1 是否需要物流
  <i class="glyphicon glyphicon-plus-sign"></i>address={"name":"罗晖","province":"上海","city":"上海","address":"金茂大厦88楼","tel":"18621509911"} 订单金额
                      

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "order": {
                    "id": 10,
                    "tinyshop": 1,
                    "date": "2014-03-03T15:26:58.938",
                    "amount": "170.00",
                    "payer": "\"12\"",
                    "detail": "[[1,34,5]]",
                    "payment": "",
                    "status": 2
                    }
}
</pre></td>
            </tr>

            <tr>
                <td>订单付款更新<br />
                    将订单更新为已付款状态
                </td>

                <td><a class="request" href="/api/?r=store.order.orderpaid" data-post='{"order_id":"12345","amount":"100","payment":"Cash"}'>store.order.submit</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>order_id=12345 订单ID
  <i class="glyphicon glyphicon-plus-sign"></i>amount=100     金额
  <i class="glyphicon glyphicon-plus-sign"></i>payment=付款方式 'Cash','Bank Card','Prepaid Card'

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "order": {
                    "id": 10,
                    "tinyshop": 1,
                    "date": "2014-03-03T15:26:58.938",
                    "amount": "170.00",
                    "payer": "\"12\"",
                    "detail": "[[1,34,5]]",
                    "payment": "",
                    "status": 2
                    }
}
</pre></td>
            </tr>
            
            <tr>
                <td>订单修改<br />
                    获取修改订单的信息<br />
                    返回更新后的订单详细信息
                </td>

                <td><a class="request" href="/api/?r=store.order.notify" data-post='{"orderid":"1","sign"：""}'>store.order.notify</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>orderid=1  商品ID
  <i class="glyphicon glyphicon-plus-sign"></i>sign="43434343" 支付人账户
  <i class="glyphicon glyphicon-plus-sign"></i>detail=[1,33,3],[2,33,3]  商品详情,[product_id,product_rice,product_num]

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "order": {
                    "id": 10,
                    "tinyshop": 1,
                    "date": "2014-03-03T15:26:58.938",
                    "amount": "170.00",
                    "payer": "\"12\"",
                    "detail": "[[1,34,5]]",
                    "payment": "",
                    "status": 2
                    }
}
</pre></td>
            </tr>
            
            
            
          <tr>
                <td>订单修改<br />
                    获取修改订单的信息<br />
                    返回更新后的订单详细信息
                </td>

                <td><a class="request" href="/api/?r=store.order.notify" data-post='{"OrderId":1,"Amount":"100","TransTime":"","TransID":"","Status":0,Sign:"aabbccdd"}'>store.order.notify</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>POST</span>
  <i class="glyphicon glyphicon-plus-sign"></i>OrderId=1  商品ID
  <i class="glyphicon glyphicon-plus-sign"></i>Amount="43434343" 支付人账户
  <i class="glyphicon glyphicon-plus-sign"></i>TransTime
  <i class="glyphicon glyphicon-plus-sign"></i>TransID
  <i class="glyphicon glyphicon-plus-sign"></i>Status
  <i class="glyphicon glyphicon-plus-sign"></i>Sign

<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
    "order": {
                    "id": 10,
                    "tinyshop": 1,
                    "date": "2014-03-03T15:26:58.938",
                    "amount": "170.00",
                    "payer": "\"12\"",
                    "detail": "[[1,34,5]]",
                    "payment": "",
                    "status": 2
                    }
}
</pre></td>
            </tr>
          <tr>
                <td>订单列表<br />
                    获取微店ID<br />
                    返回订单详细信息列表
                </td>


                <td><a class="request" href="/api/?r=store.order.list">store.order.list</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
"orderList": [{
                    "id": 10,
                    "tinyshop": 1,
                    "date": "2014-03-03T07:26:58Z",
                    "amount": "170.00",
                    "payer": "\"12\"",
                    "detail": "[[1,34,5]]",
                    "payment": "",
                    "status": 2
                    }]
}
</pre></td>
            </tr>

          <tr>
                <td>订单详情<br />
                    获取订单ID<br />
                    返回订单详细信息
                </td>


                <td><a class="request" href="/api/?r=store.order.detail" data-get='{"order_id":1}'>store.order.detail</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
  <i class="glyphicon glyphicon-plus-sign"></i>order_id=1  订单ID
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
"order": {
                    "id": 10,
                    "tinyshop": 1,
                    "date": "2014-03-03T07:26:58Z",
                    "amount": "170.00",
                    "payer": "\"12\"",
                    "detail": "[[1,34,5]]",
                    "payment": "",
                    "status": 2
                    }
}
</pre></td>
            </tr>
            <tr>
                <td>商品分类<br />
                    返回商品分类信息
                </td>


                <td><a class="request" href="/api/?r=store.goods.category" data-get='{}'>store.goods.category</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
                    "goodscategory":
                    [
                    {"id": 1,"name": "\u6253\u7b97\u6253"},
                    {"id": 2, "name": "\u7684\u53d1\u987a\u4e30"}
                    ],
                    "r": "",
                    "success": true,
                    "sign": ""
}
</pre></td>
            </tr>
                      <tr>
                <td>商品分类库<br />
                    返回商品分类信息的详细信息
                </td>


                <td><a class="request" href="/api/?r=store.goods.lib" data-get='{"category_id":1}'>store.goods.lib</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
                    <i class="glyphicon glyphicon-plus-sign"></i>category_id=1  分类ID
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
                    "goodslib"：
                    [{
                    "id": 1,
                    "name": "\u6905\u5b50",
                    "category": 1,
                    "price": "545.00",
                    "image": "/site_media/store/category/pic01.png",
                    "information": "sdadsaddd"
                    }]
}
</pre></td>
            </tr>
               <tr>
                <td>默认商品详情<br />
                    通过默认商品的ID，获取商品的详细信息
                </td>


                <td><a class="request" href="/api/?r=store.goods.detail" data-get='{"id":1}'>store.goods.detail</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
                    <i class="glyphicon glyphicon-plus-sign"></i>id=1  默认商品ID
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
{
"goods":
                    {
                    "id": 1,
                    "name": "\u6905\u5b50",
                    "category": 1,
                    "price": "545.00",
                    "image": "/store/category/pic01.png",
                    "information": "sdadsaddd"
                    }

}
</pre></td>
            </tr>
            <tr>
                <td>Report<br />
                    获得报表
                </td>


                <td><a class="request" href="/api/?r=store.report.dashboard" data-get='{"id":1}'>store.report.dashboard</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
                    <i class="glyphicon glyphicon-plus-sign"></i>fromDay=20140101  报表起始时间。 起始时间和结束时间不得超过1个月
                    <i class="glyphicon glyphicon-plus-sign"></i>toDay=20140201  报表结束时间。 起始时间和结束时间不得超过1个月
                    
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
"goods":
                    {
                    "id": 1,
                    "name": "\u6905\u5b50",
                    "category": 1,
                    "price": "545.00",
                    "image": "/store/category/pic01.png",
                    "information": "sdadsaddd"
                    }

}
</pre></td>
            </tr>
            <tr>
                <td>Report<br />
                    获得日期销售报表
                </td>
                <td><a class="request" href="/api/?r=store.report.days" data-get='{"id":1}'>store.report.days</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
                    <i class="glyphicon glyphicon-plus-sign"></i>fromDay=20140101  报表起始时间。 起始时间和结束时间不得超过1个月
                    <i class="glyphicon glyphicon-plus-sign"></i>toDay=20140201  报表结束时间。 起始时间和结束时间不得超过1个月
                    
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
"goods":
                    {
                    "id": 1,
                    "name": "\u6905\u5b50",
                    "category": 1,
                    "price": "545.00",
                    "image": "/store/category/pic01.png",
                    "information": "sdadsaddd"
                    }

}
</pre></td>
            </tr>
            <tr>
                <td>Report<br />
                    获得产品报表
                </td>
                <td><a class="request" href="/api/?r=store.report.products" data-get='{"id":1}'>store.report.products</a></td>
                <td><pre>
<span class="add-on"><i class="glyphicon glyphicon-cloud-upload"></i>GET</span>
                    <i class="glyphicon glyphicon-plus-sign"></i>fromDay=20140101  报表起始时间。 起始时间和结束时间不得超过1个月
                    <i class="glyphicon glyphicon-plus-sign"></i>toDay=20140201  报表结束时间。 起始时间和结束时间不得超过1个月
                    
<span class="add-on"><i class="glyphicon glyphicon-cloud-download"></i>RETURN</span>
"goods":
                    {
                    "id": 1,
                    "name": "\u6905\u5b50",
                    "category": 1,
                    "price": "545.00",
                    "image": "/store/category/pic01.png",
                    "information": "sdadsaddd"
                    }

}
</pre></td>
            </tr>
          </tbody>
      </table>


    </div> <!-- /container -->

    <!-- Modal -->
    <div class="modal fade" id="responseModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h3 class="modal-title btn btn-info"></h3>
          </div>
          <div class="modal-body">
            <pre><code></code></pre>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
        </div>
      </div>
    </div>

<footer>
    CopyRight jfpal.com
</footer>


<script type="text/javascript">
//implement JSON.stringify serialization
JSON.stringify = JSON.stringify || function (obj) {
    var t = typeof (obj);
    if (t != "object" || obj === null) {
        // simple data type
        if (t == "string") obj = '"'+obj+'"';
        return String(obj);
    }
    else {
        // recurse array or object
        var n, v, json = [], arr = (obj && obj.constructor == Array);
        for (n in obj) {
            v = obj[n]; t = typeof(v);
            if (t == "string") v = '"'+v+'"';
            else if (t == "object" && v !== null) v = JSON.stringify(v);
            json.push((arr ? "" : '"' + n + '":') + String(v));
        }
        return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
    }
};

$(function(){
    $('a[rel="tooltip"]').tooltip();
    $('a.request').click(function(){
        var reqType = 'GET', reqData = {}, $this=$(this);
        if($(this).data('post')){
            reqData = $(this).data('post');
            reqType = 'POST';
        }
        else if($(this).data('get')) {
            reqData = $(this).data('get');
        }

        $.ajax({
            url: $(this).attr('href'),
            type: reqType,
            data: reqData,
        }).done(
            function(data){
                if(console && console.info) {
                    console.info('resp', data);
                }
                var plainText = 'Error';
                if( jQuery.type(data) === "string" ) {
                    plainText = data;
                }
                else {
                    plainText = JSON.stringify(data, null, 4);
                }
                $('#responseModel .modal-header h3').html($this.text());
                $('#responseModel .modal-body code').text(plainText).prepend(""+ jQuery.type(data) + "<i class='glyphicon glyphicon-arrow-right'></i>");
                $('#responseModel').modal('show');
            }
        );
        return false;
    });
});
</script>
  </body>
</html>
